package com.meter.data.protocol.param;

import com.meter.common.utils.HexUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component("iecmReadParam")
public class IecmParam {

    public static String paramRead(String deviceCode, String meterNo, String factoryCode) {
        String msg = HexUtils.strChangeStrDesc(deviceCode, 2, true) + " " + HexUtils.strChangeStr(meterNo, 2, true) + " 01 " + factoryCode + " 00 00 00 00 00 ";
        String cs = HexUtils.hexCheckStr(msg.split(" "));
        String receiveStr = "AA " + msg + cs + " FF";
        return receiveStr;
    }
}
